import Vue from 'vue'
import Router from 'vue-router'
import Layout from '../page/layout/Layout'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: require('@/page/login').default
    },
    {
      path: '/forgetPassword',
      name: 'forgetPassword',
      component: require('@/page/forgetPassword').default
    },
    {
      path: '/editPassword',
      name: 'editPassword',
      component: require('@/page/editPassword').default
    },
    {
      path: '/admin',
      component: Layout,
      redirect: '/admin/home',
      children: [{
        path: 'home',
        name: 'home',
        component: resolve => require(['@/page/home'],resolve),
      }]
    },
    {
      path: '/setting',
      component: Layout,
      redirect: '/setting/base',
      name: 'setting',
      children: [{
          path: 'base',
          name: 'base',
          component: resolve => require(['@/page/settingBase'],resolve),
      }]
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})
